Skip to content

test(e2e): Add end-to-end tests simulating neural-network workloads on a Spider cluster. - #385

Merged
sitaowang1998 merged 56 commits into
y-scope:mainfrom
sitaowang1998:nn-test-driver
Aug 22, 2026
Merged

test(e2e): Add end-to-end tests simulating neural-network workloads on a Spider cluster.#385
sitaowang1998 merged 56 commits into
y-scope:mainfrom
sitaowang1998:nn-test-driver

Conversation

@sitaowang1998

@sitaowang1998 sitaowang1998 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds neural-network integration test, with the following change:

  • tests/huntsman/e2e/src/nn: New mod contains neural network helpers.
    • neuron.rs: Neuron activation enums and mapping to task name and evaluate function.
    • wiring.rs: Wiring outputs to inputs.
    • network.rs: NeuralNetwork struct that holds all neural network information and conversion to TaskGraph.
  • tests/huntsman/e2e/payload_serde.rs: Helpers that serialize/deserialize task msgpack input/output payload.
  • taskfiles/test.yaml: Excludes e2e tests from test:rust-unit-tests task.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Run neural network test on a Spider stack. The test codes are in another branch.
  • GitHub workflows pass.

Summary by CodeRabbit

  • New Features
    • Added an end-to-end neural-network workflow with layered neuron graphs, deterministic wiring, and ReLU, sigmoid, and identity activations.
    • Added MessagePack payload encoding and decoding for task inputs and outputs.
    • Added validation for neural-network layer wiring and test payload handling.
  • Tests
    • Added an asynchronous end-to-end test that submits generated networks and verifies results against in-process simulation.
  • Bug Fixes
    • Updated standard test execution to exclude end-to-end tests, preventing duplicate runs.

@sitaowang1998
sitaowang1998 requested a review from a team as a code owner July 10, 2026 06:25
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 35baaaa3-d4e4-49cd-b7cc-6066ae5606af

📥 Commits

Reviewing files that changed from the base of the PR and between 36de57d and 5f37b14.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • tests/huntsman/e2e/src/nn/wiring.rs
  • tests/huntsman/e2e/src/payload_serde.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/huntsman/e2e/src/nn/wiring.rs
  • tests/huntsman/e2e/src/payload_serde.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Adds a layered neural-network workload to the Huntsman e2e crate. It includes deterministic wiring, MessagePack payload helpers, Spider execution validation, and exclusion of e2e tests from the unit-test executor.

Changes

Neural network end-to-end validation

Layer / File(s) Summary
Network model and deterministic wiring
tests/huntsman/e2e/Cargo.toml, tests/huntsman/e2e/src/lib.rs, tests/huntsman/e2e/src/nn/*
Defines activation mappings, validates and generates deterministic layer wiring, and provides task-graph construction plus in-process simulation.
MessagePack payload codec
tests/huntsman/e2e/src/payload_serde.rs
Adds input encoding and output decoding with round-trip, floating-point, struct, multi-value, and malformed-payload tests.
Spider-backed network validation
tests/huntsman/e2e/tests/nn.rs, taskfiles/test.yaml
Adds a deterministic asynchronous Spider comparison test and excludes e2e tests from the standard unit-test executor.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 5f37b

This PR adds neural-network end-to-end test support without any identified current-head correctness or production-impact issue; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant test_nn
  participant NeuralNetwork
  participant SpiderTestDriver
  participant Spider
  test_nn->>NeuralNetwork: simulate deterministic inputs
  test_nn->>NeuralNetwork: build task graph
  test_nn->>SpiderTestDriver: submit graph and encoded inputs
  SpiderTestDriver->>Spider: execute dense-neuron tasks
  Spider-->>SpiderTestDriver: return outputs
  SpiderTestDriver-->>test_nn: decode output payload
  test_nn->>test_nn: compare outputs with simulation
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 5 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the new end-to-end neural-network tests for Spider.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LinZhihao-723 LinZhihao-723 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm good with the shape. Shouldn't take too much effort to merge it.

Comment thread tests/huntsman/e2e/src/nn/wiring.rs Outdated
Comment thread tests/huntsman/e2e/src/nn/wiring.rs Outdated
Comment thread tests/huntsman/e2e/src/nn/wiring.rs Outdated
Comment thread tests/huntsman/e2e/src/nn/network.rs
Comment thread tests/huntsman/e2e/src/payload_serde.rs Outdated
Comment thread tests/huntsman/e2e/src/payload_serde.rs Outdated
Comment thread tests/huntsman/e2e/tests/nn.rs Outdated
Comment thread tests/huntsman/e2e/tests/nn.rs
Comment thread taskfiles/test.yaml Outdated
cp "{{.G_RUST_RELEASE_DIR}}/libintegration_test_tasks.so" \
"{{.G_TDL_PACKAGES_DIR}}/integration_test_tasks/libintegration_test_tasks.so"
cargo nextest run --all --all-features --run-ignored all --release
cargo nextest run --all --all-features --run-ignored all --release \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do some research on whether we can make this better to understand.

Comment thread tests/huntsman/e2e/src/payload_serde.rs Outdated
Comment thread tests/huntsman/e2e/src/payload_serde.rs Outdated
…argo target so the Rust unit-test flow no longer needs a nextest filter expression.

Mark the `nn` integration test target with `test = false` so it is excluded from
default target selection, and drop the
`-E 'not (package(e2e) & kind(test))'` filter from the unit-test task. The
target is still built and driven by nextest through explicit selection:

    cargo nextest run -p e2e --all-features --release --test nn
Comment thread tests/huntsman/e2e/tests/nn.rs Outdated

[[test]]
name = "nn"
test = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this will disable the test by default. There's no need to explicitly disable it in the current task.
To run the nn test case:

cargo nextest run --package e2e --all-features --release --test nn

@LinZhihao-723 LinZhihao-723 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the PR title, how about:

test(e2e): Add end-to-end tests simulating neural-network workloads on a Spider cluster.

@sitaowang1998 sitaowang1998 changed the title test(e2e): Add neural-network integration test. test(e2e): Add end-to-end tests simulating neural-network workloads on a Spider cluster. Aug 22, 2026
@sitaowang1998
sitaowang1998 merged commit 8174d9a into y-scope:main Aug 22, 2026
23 checks passed
@sitaowang1998
sitaowang1998 deleted the nn-test-driver branch August 22, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants